<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title>mouseup 和 mousedown 事件</title>
</head>
<body>
<form action="" name="form1">
    <input type="button" name="myButton" value="Mouse goes up">
</form>
<script>
    var myButton = document.form1.myButton;

    function myButtonMouseup() {
        myButton.value = 'Mouse Goes Up';
    }

    function myButtonMouseDown() {
        myButton.value = 'Mouse Goes Down';
    }

    myButton.addEventListener('mouseup', myButtonMouseup);
    myButton.addEventListener('mousedown', myButtonMouseDown);
</script>
</body>
</html>